#!/usr/bin/env ruby
# frozen_string_literal: true

# Build Nginx config files with ERB template
require "erb"

TEMPLATE_FILES = %w[nginx.conf homeland.conf]
TEMPLATE_FILES.each do |fname|
  file_path = File.expand_path(File.join(__FILE__, "../#{fname}.erb"))
  out_path = File.expand_path(File.join(__FILE__, "../#{fname}"))
  out = ERB.new(File.read(file_path)).result
  File.write(out_path, out)
end
